<template>
	<view class="patient-content">
		<view class="cu-timeline">
			<view class="cu-item text-blue" v-for="(item,index) in dataList" :key="index">
				<view class="content">
					<view class="patient-item-title">
						<text class="patient-item-time">2019-10-19 10:25:54</text>
						<text>{{item.revisit}}</text>
					</view>
					<view class="patient-item-fill">{{item.revisitContent}}</view>
				</view>
			</view>
			<view class="cu-time cu-time-btm">到底了喽~</view>
		</view>
	</view>
</template>

<script>
	import { returnVisitList } from '@/static/api/returnVisit.js'
	export default {
		data() {
			return {
				dataList:[],	// 存放回访列表数组
				parame:{
					arrivalTime: "",	// 页面顶部或底部记录的到店时间
					customerId: "",		// 患者ID
					refreshType: "",	// up:上拉,down:下拉
					revisitStatus: "",	// 1 待计划 2 回访完成 3 未完成 4 取消
					roleName: "doctor",	// 角色名称(doctor,tc)
					selectedDept: "",	// 选择的门诊
					simpleName: ""		// 门诊简称
				}
			};
		},
		onLoad:function(option){
			let _this = this
			//	接受从上个页面传递过来的参数 ID
			_this.parame.customerId = option.id;
			
			//	取出存在 cookie 里面 abbreviation(门店缩写)
			uni.getStorage({
			    key: 'userInfo',
			    success: function (res) {
					_this.parame.selectedDept = res.data.outpatientShrink;
					_this.parame.simpleName = res.data.outpatientSimple;
					//	请求患者详情数据
					returnVisitList(_this.parame).then((res)=>{
						console.log(res.data);
						_this.dataList = res.data
					})
			    }
			});
		},
		methods: {
			onNavigationBarButtonTap(val) {
                if (val.index == 0) {
                    uni.navigateTo({
						url: `/pages/index/returnVisit/returnVisit-addTo`,
					})
                }
			}
		}
	}
</script>

<style lang="scss">
	page{
		height: 100%;
	}
	
	.patient-content{
		background-color: #FFFFFF;
		height: 100%;
		padding-top: 30rpx;
	}
	
	.patient-item-title{
		color:rgb(134,184,253);
		
		.patient-item-time{
			color: black;
			padding-right: 15rpx;
			vertical-align: middle;
		}
	}
	
	// 时间轴样式修改
	.cu-timeline>.cu-item>.content:not([class*="bg-"]){
		background-color: #FFFFFF;
	}
	.cu-timeline>.cu-item::before{
		top: 0;
		color: rgb(134,184,253);
		font-size: 16px;
	}
	.cu-timeline>.cu-item::after{
		background-color: rgb(134,184,253);
		width: 2rpx;
	}
	.cu-timeline>.cu-item>.content{
		padding: 0 30rpx;
	}
	.cu-timeline>.cu-item{
		padding: 0 30rpx 30rpx 80rpx;
	}
	.cu-timeline .cu-time-btm{
		width: 150rpx;
	}
</style>
